<#include "/common/layout.ftl">


<@layout >
    <div class="frame-content" style="background: white;">
        <table id="table"></table>
    </div>
</@layout>

<@script>

    <script type="text/javascript">

        HsUtils.initTreeTable("#table", "id", "parentId", "id", [
            {field: 'id', title: '#'},
            {field: 'title', title: '字典标题'},
            {field: 'value', title: '默认值'},
            {field: 'description', title: '描述'},
            {
                field: 'operate',
                title: '操作',
                align: 'center',
                formatter: function (value, row) {
                    var DICTIONARY_FORM_ID = 2;
                    return [
                        HsUtils.buildTableActionBtn('添加', Const.btnType.PRIMARY, '/admin/dictionary/add?id=' + row.id, row.title, DICTIONARY_FORM_ID),
                        HsUtils.buildTableActionBtn('修改', Const.btnType.WARNING, '/admin/dictionary/edit?id=' + row.id, row.title, DICTIONARY_FORM_ID),
                        HsUtils.buildTableActionBtn('删除', Const.btnType.DANGER, '/admin/dictionary/del?id=' + row.id, row.title)
                    ].join('');
                }
            },
        ], JSON.parse('${dictionaryItems }'));

    </script>
</@script>
